package com.gsezone.s12;

import java.util.ArrayList;
import java.util.Collection;

import com.gsezone.s12.model.User;

public class MyCollection {

	public static void main(String[] args) {
		
		Collection<User> users = new ArrayList<>();

		users.add(new User(1l, "Grzegorz"));
		users.add(new User(2l, "Marek"));
		users.add(new User(3l, "Karol"));
		
		System.out.println(users);

		users.add(new User(4l, "Lukasz"));
		
		System.out.println(users);

		User lukasz = null;
		
		for (User user : users) {
			if (user.getId().equals(4l))
				lukasz = user;
		}
		
		System.out.println(lukasz.getName());
	}
	
}
